Friend Class DBScanSchedule_Factory
    Inherits DBBase

    Public Function GetScheduleForDatabase( _
                            ByVal lDatabaseID As Long, _
                            ByVal lType As ScanSchedule.Type) As ScanSchedule

        Dim oScanSchedule As ScanSchedule = Nothing

        Dim sSQL As String = "select"
        sSQL = sSQL & "     [ID]"
        sSQL = sSQL & " from"
        sSQL = sSQL & "     ScanSchedule"
        sSQL = sSQL & " where"
        sSQL = sSQL & "     DatabaseID=" & lDatabaseID
        sSQL = sSQL & "     and ScanTypeID=" & Val(lType)

        Dim oValue As Object = MyBase.ExecuteScalar(sSQL)

        If Not oValue Is Nothing Then
            oScanSchedule = New ScanSchedule(Val(oValue))
            oScanSchedule.Load()
        End If

        Return oScanSchedule
    End Function
End Class
